package cliente;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

import interfaces.AdministracionCentralInterface;

public class ClienteAdminCentral {

	private static AdministracionCentralInterface adminCentral;
	
	public static AdministracionCentralInterface obtenerSistema(){
		if( adminCentral == null )
		{
			try
			{
				adminCentral = ( AdministracionCentralInterface ) Naming.lookup("//localhost/AdministracionCentral");
			}
			catch (MalformedURLException e) 
			{
				e.printStackTrace();
			}
			catch (RemoteException e)
			{
				e.printStackTrace();
			}
			catch (NotBoundException e)
			{
				e.printStackTrace();
			}
		}
		return adminCentral;
	}
}
